Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting X-Forwarded-For inside of ALB setup #904

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

hellais
Copy link
Member

@hellais hellais commented Dec 11, 2024

If somebody is setting X-Forwarded-For it will lead to X-Real-Ip containing a list instead of a fixed IP.

We can instead trust the last item in the X-Forwarded-For list since this comes from ALB as we are running it in append mode (see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html)

We should make sure we don't change the mode to something other than append otherwise we expose to ourselves to clients overriding X-Real-Ip.

Fixes: #901

If somebody is setting X-Forwarded-For it will lead to X-Real-Ip
containing a list instead of a fixed IP.

We can instead trust the last item in the X-Forwarded-For list since
this comes from ALB as we are running it in append mode (see:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html)
@hellais hellais merged commit 032eefd into master Dec 18, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the reverse proxy of api.ooni.org incorrectly rewrites "X-Forwarded-For" header
1 participant